package com.hmy.finance.dal.po;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.hmy.finance.dal.po.json.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 应收盘点
 *
 * @TableName receivable_Inventory
 */
@TableName(value = "receivable_inventory", autoResultMap = true)
@Data
public class ReceivableInventoryPo implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 3365683472932045468L;
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 客户ID
     */
    @TableField(value = "customer_id")
    private Long customerId;

    /**
     * 客户名称
     */
    @TableField(value = "customer_name")
    private String customerName;

    /**
     * 客户签约人id
     */
    @TableField(value = "signatory_id")
    private Long signatoryId;

    /**
     * 承租人1
     */
    @TableField(value = "lessee_first")
    private String lesseeFirst;

    /**
     * 承租人2
     */
    @TableField(value = "lessee_second")
    private String lesseeSecond;

    /**
     * 销售合同ID
     */
    @TableField(value = "contract_id")
    private Long contractId;

    /**
     * 销售合同编号
     */
    @TableField(value = "contract_no")
    private String contractNo;

    /**
     * 订单ID
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 总营收
     */
    @TableField(value = "total_revenue_amount")
    private BigDecimal totalRevenueAmount;

    /**
     * 已开票金额
     */
    @TableField(value = "total_invoiced_amount")
    private BigDecimal totalInvoicedAmount;

    /**
     * 已对账总额
     */
    @TableField(value = "total_reconciliationed_amount")
    private BigDecimal totalReconciliationedAmount;

    /**
     * 历史已对账金额
     */
    @TableField(value = "history_reconciliationed_amount")
    private BigDecimal historyReconciliationedAmount;

    /**
     * 未对账总额
     */
    @TableField(value = "total_unreconciliation_amount")
    private BigDecimal totalUnreconciliationAmount;

    /**
     * 已回款总额
     */
    @TableField(value = "total_received_amount")
    private BigDecimal totalReceivedAmount;

    /**
     * 最后一次回款时间
     */
    @TableField(value = "last_received_time")
    private LocalDateTime lastReceivedTime;

    /**
     * 应收余额合计
     */
    @TableField(value = "total_receivable_amount")
    private BigDecimal totalReceivableAmount;

    /**
     * 未到期金额
     */
    @TableField(value = "unexpired_amount")
    private BigDecimal unexpiredAmount;

    /**
     * 当期金额
     */
    @TableField(value = "current_amount")
    private BigDecimal currentAmount;

    /**
     * 逾期盘点
     */
    @TableField(value = "overdue_detail", typeHandler = OverdueInfoJsonHandler.class)
    private List<OverdueDetailJson> overdueDetail;

    /**
     * 逾期总计
     */
    @TableField(value = "total_overdue_amount")
    private BigDecimal totalOverdueAmount;

    /**
     * 销售经理ID
     */
    @TableField(value = "sale_manager_id")
    private Long saleManagerId;

    /**
     * 销售经理姓名
     */
    @TableField(value = "sale_manager_name")
    private String saleManagerName;

    /**
     * 部门ID
     */
    @TableField(value = "sale_manager_dept_id")
    private Long saleManagerDeptId;

    /**
     * 客户扩展信息
     */
    @TableField(value = "customer_extension_info", typeHandler = JacksonTypeHandler.class)
    private CustomerExtensionInfoJson customerExtensionInfo;

    /**
     * 合同签署时间
     */
    @TableField(value = "contract_sign_time")
    private LocalDateTime contractSignTime;

    /**
     * 合同扩展信息
     */
    @TableField(value = "contract_extension_info", typeHandler = JacksonTypeHandler.class)
    private ContractExtensionInfoJson contractExtensionInfo;

    /**
     * 订单扩展信息
     */
    @TableField(value = "order_extension_info", typeHandler = JacksonTypeHandler.class)
    private OrderExtensionInfoJson orderExtensionInfo;

    /**
     * 冲抵处理截止日期
     */
    @TableField(value = "offset_through_date")
    private LocalDate offsetThroughDate;

    /**
     * 逻辑删除
     */
    @TableField(value = "is_deleted")
    @TableLogic
    private Integer isDeleted;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField(value = "updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField(value = "updater_name")
    private String updaterName;

}
